package cn.wonderland.org.domain;

import cn.wonderland.base.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
// implements Serializable 只要实现了这个接口 这个类的实体就可以被序列化和反序列化
public class Department extends BaseDomain implements Serializable {

    private String sn;
    private String name;
    private String dirPath;
    private Integer state;
    private Long managerId;
    private Long parentId;
    private Long shopId;

    // 负责人
    private Employee  manager;
    // 上级部门
    private Department parent;
    // 无限级数
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();
}

